<html>
<head><meta charset="utf-8"><title>Excluding building test · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html">Excluding building test</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="225173452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225173452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225173452">(Feb 04 2021 at 15:21)</a>:</h4>
<p>Hey, how can I exclude building the <code>test</code> crate for a target which doesn't support it?</p>
<p>I tried <code>x.py build --stage 1 library/std --exclude library/test</code> but it seems to be excluding everything. For info I'm building on the <code>stable</code> branch.</p>
<div class="codehilite"><pre><span></span><code>Skipping Set({&quot;library\\alloc&quot;, &quot;library\\core&quot;, &quot;library\\panic_abort&quot;, &quot;library\\panic_unwind&quot;, &quot;library\\proc_macro&quot;, &quot;library\\std&quot;, &quot;library\\term&quot;, &quot;library\\test&quot;, &quot;library\\unwind&quot;}) because it is excluded
Skipping Set({&quot;library\\alloc&quot;, &quot;library\\core&quot;, &quot;library\\panic_abort&quot;, &quot;library\\panic_unwind&quot;, &quot;library\\proc_macro&quot;, &quot;library\\std&quot;, &quot;library\\term&quot;, &quot;library\\test&quot;, &quot;library\\unwind&quot;}) because it is excluded
Build completed successfully in 0:00:01
</code></pre></div>



<a name="225173613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225173613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225173613">(Feb 04 2021 at 15:22)</a>:</h4>
<p><span class="user-mention" data-user-id="219696">@XAMPPRocky</span> I don't think x.py supports building or filtering individual crates currently. Would love to have that feature added though</p>



<a name="225173774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225173774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225173774">(Feb 04 2021 at 15:23)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Then what does <code>--exclude</code> <em>do</em>?</p>



<a name="225173898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225173898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225173898">(Feb 04 2021 at 15:24)</a>:</h4>
<p>It excludes paths, not individual crates</p>



<a name="225173959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225173959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225173959">(Feb 04 2021 at 15:24)</a>:</h4>
<p>You'd use it like <code>x.py test --exclude src/tools/tidy</code></p>



<a name="225174066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225174066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225174066">(Feb 04 2021 at 15:25)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> See that's confusing, because that's also a crate.</p>



<a name="225174105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225174105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225174105">(Feb 04 2021 at 15:25)</a>:</h4>
<p>I didn't claim it makes sense <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="225174155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225174155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225174155">(Feb 04 2021 at 15:25)</a>:</h4>
<p>That's just the granularity x.py happens to have right now</p>



<a name="225174312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225174312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225174312">(Feb 04 2021 at 15:26)</a>:</h4>
<p>Well, in the source code if i wanted to test disabling the <code>test</code> crate, what's the best place to do so?</p>



<a name="225174497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225174497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225174497">(Feb 04 2021 at 15:28)</a>:</h4>
<p>If you just need a hacky workaround, I think changing <code>impl Step for Std</code> in src/bootstrap/compile.rs is the right place</p>



<a name="225174528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225174528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225174528">(Feb 04 2021 at 15:28)</a>:</h4>
<p>Add -p std or something to the cargo invocation</p>



<a name="225174717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225174717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225174717">(Feb 04 2021 at 15:29)</a>:</h4>
<p>Hacky workarounds is all I've got. Thanks <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="225183408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225183408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225183408">(Feb 04 2021 at 16:22)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Same question, but for rustdoc, I couldn't where it's being built in bootstrap?</p>



<a name="225183456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225183456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225183456">(Feb 04 2021 at 16:23)</a>:</h4>
<p><span class="user-mention" data-user-id="219696">@XAMPPRocky</span> <a href="http://tool.rs">tool.rs</a></p>



<a name="225183481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225183481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225183481">(Feb 04 2021 at 16:23)</a>:</h4>
<p>Searching <code>impl Step for X</code> almost always works</p>



<a name="225183603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225183603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225183603">(Feb 04 2021 at 16:24)</a>:</h4>
<p>You shouldn't need to special case it though, exclude should work (or just don't tell x.py to build it in the first place: <code>x.py build library/std</code>)</p>



<a name="225183662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225183662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225183662">(Feb 04 2021 at 16:24)</a>:</h4>
<p>Why can't rustdoc be built? Does it depend on libtest or something?</p>



<a name="225183775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225183775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225183775">(Feb 04 2021 at 16:25)</a>:</h4>
<blockquote>
<p>Why can't rustdoc be built? Does it depend on libtest or something?</p>
</blockquote>
<p>Exactly that.</p>



<a name="225183808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225183808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225183808">(Feb 04 2021 at 16:25)</a>:</h4>
<p>Oh right, doctests</p>



<a name="225184063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225184063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225184063">(Feb 04 2021 at 16:26)</a>:</h4>
<p>Now I'm curious how a platform could support libstd but not libtest</p>



<a name="225189179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Excluding%20building%20test/near/225189179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Excluding.20building.20test.html#225189179">(Feb 04 2021 at 16:59)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Can't get into it too much, because it's a proprietary platform under an NDA, it probably could eventually compile libtest if I tried hard enough but there's weird linker errors that probably require bootstrap changes I'd rather not deal with right now. I'm more concerned about being able to build a dist version of just <code>rustc</code> + <code>std</code> at the moment than having <code>std</code> and all related tools.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>